package com.example.market.controller;

import com.example.market.pojo.Carousel;
import com.example.market.service.CarouselService;
import com.example.market.util.JsonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CarouselController {

    @Autowired
    private JsonResponse jsonResponse;
    @Autowired
    private CarouselService carouselService;

    @GetMapping("/resources/carousel")
    public JsonResponse carousels() {
        List<Carousel> carousels = carouselService.getCarouselList();
        jsonResponse.success("001", carousels);
        return jsonResponse;
    }
}